package p1;

public class T07 {
    public static void main(String[] args) throws CloneNotSupportedException {
        System.out.println(MyClazz.instance);
        Object o1=new Object();
        MyClazz cc= (MyClazz) MyClazz.instance.clone();

    }
}
class MyClazz implements Cloneable{
    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    int a;
    public static MyClazz instance=new MyClazz();
    private MyClazz(){

    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        MyClazz c=new MyClazz();
        c.setA(a);
        return c;
    }
}
